reading-notes

jQuery intro

jQuery offers a simple way to achieve a variety of common JavaScript tasks quickly and consistently, across all major browsers and without any fallback code needed.

in jQuery you can do

In order to use jQuery, the first thing you need to do is include the jQuery script in your page. You can includ it before the closing </body> tag.

Once jQuery has been added to the page, a second JavaScript file is included that uses jQuery selectors and methods to update the content of the HTML page.

The JavaScript file uses the $() shortcut for the jQuery() function.

Rather than learn a new way to select elements, jQuery uses a language that is already familiar to front-end web developers: CSS selectors. They: • Are much faster at selecting elements • Can be a lot more accurate about which elements to select • Often require a lot less code than older DOM methods • Are already used by most front-end developers

jQuery has methods that offer web developers simpler ways to perform common tasks, such as: • loop through elements • Add I remove elements from the DOM tree • Handle events • Fade elements into I out of view • Handle Ajax requests